package com.tiancheng.trade.payment.controller.admin;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.payment.service.PaymentRefundFlowDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 支付流水明细
 */
@RestController
@RequestMapping("/admin/refundDetail")
@Validated
@Slf4j
public class PaymentRefundFlowDetailAdminController {

	@Autowired
	PaymentRefundFlowDetailService paymentRefundFlowDetailService;



	/**
	 * 根据id获取支付流水
	 *
	 * @param flowId
	 * @return
	 */
	@GetMapping("/findByFlowId/{flowId}")
	public Result findByFlowId(@PathVariable String flowId) {
		return Result.success(paymentRefundFlowDetailService.findByFlowId(flowId));
	}

	/**
	 * 根据id获取支付流水
	 *
	 * @param flowId
	 * @return
	 */
	@GetMapping("/findSettleByFlowId/{flowId}")
	public Result findSettleByFlowId(@PathVariable String flowId) {
		return Result.success(paymentRefundFlowDetailService.findSettleByFlowId(flowId));
	}

}
